package com.huazhi.wzsnw.service.impl;

import com.huazhi.wzsnw.mapper.MenuMapper;
import com.huazhi.wzsnw.model.Menu;
import com.huazhi.wzsnw.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MenuServiceImpl implements MenuService {
    @Autowired
    private MenuMapper menuMapper;

    @Override
    public int save(Menu record) {
        menuMapper.insertSelective(record);
        return 0;
    }

    @Override
    public int delete(Menu record)
    {
        menuMapper.updateByPrimaryKeySelective(record);
        return 0;
    }

    @Override
    public int deletes(List<Menu> records) {
        return 0;
    }

    @Override
    public int update(Menu record) {
        menuMapper.updateByPrimaryKeySelective(record);
        return 0;
    }

    @Override
    public Menu findByTid(String tid) {
        return menuMapper.selectByPrimaryKey(tid);
    }

    @Override
    public List<Menu> findAll() {
        return menuMapper.selectAll();
    }


    @Override
    public List<Menu> findPagingByListTid(List<String> stringList, Integer pageIndex, Integer pageSize) {
        return menuMapper.findPagingByListTid(stringList,pageIndex,pageSize);
    }

    @Override
    public List<Menu> findPid(String pid) {
        return menuMapper.findPid(pid);
    }
}
